package com.yourenbang.lingyun.transaction.constant;

import java.math.BigDecimal;

/**
 * Created on 2021/12/9
 *
 * @author qinmingtao
 * desc 贝管家提现接口对接枚举
 */
public class BeiGuanJiaWithdrawEnum {
    /**
     * 账户类型，101 分润 102 返现 103 高返
     */
    public enum BGJ_ACCOUNT_TYPE_ENUM {
        /**
         * 分润
         */
        DISTRIBUTION_PROFITS("101", "分润"),
        /**
         * 返现
         */
        CASH_BACK("102", "返现"),
        /**
         * 高返
         */
        HIGH_BACK("103", "高返"),
        ;
        private String code;
        private String desc;

        BGJ_ACCOUNT_TYPE_ENUM(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    /**
     * 产品类型 3 max 4 传统大pos
     */
    public enum BGJ_PRODUCT_TYPE_ENUM {
        /**
         * max
         */
        MAX("3", "max"),
        /**
         * 传统大pos
         */
        BIG_POS("5", "传统大pos"),
        ;
        private String code;
        private String desc;

        BGJ_PRODUCT_TYPE_ENUM(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    /**
     * 订单状态 01-出款成功 02-出款失败 03-审核拒绝 04-进行中 05-待审核
     */
    public enum BGJ_WITHDRAW_STATUS_ENUM {
        /**
         * 出款成功
         */
        STATUS_01("01", "出款成功"),
        /**
         * 出款失败
         */
        STATUS_02("02", "出款失败"),
        /**
         * 审核拒绝
         */
        STATUS_03("03", "审核拒绝"),
        /**
         * 进行中
         */
        STATUS_04("04", "进行中"),
        /**
         * 待审核
         */
        STATUS_05("05", "待审核"),
        ;

        private String code;
        private String desc;

        BGJ_WITHDRAW_STATUS_ENUM(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        /**
         * 通过状态码获取状态描述
         * @param code 状态码
         * @return 状态描述
         */
        public static String getStatusDesc(String code){
            for (BGJ_WITHDRAW_STATUS_ENUM value : values()) {
                if(value.getCode().equals(code)){
                    return value.getDesc();
                }
            }
            return "状态异常";
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    /**
     * 提现限额配置名
     */
    public enum BGJ_WITHDRAW_LIMIT_CONFIG {
        /**
         * 单笔最小
         */
        WITHDRAW_MIN("withdrawMin", new BigDecimal(10)),
        /**
         * 单笔最大
         */
        WITHDRAW_MAX("withdrawMax", new BigDecimal(50000)),
        /**
         * 单日最大
         */
        WITHDRAW_DAY_MAX("withdrawDayMax", new BigDecimal(100000));

        private String code;
        private BigDecimal value;

        BGJ_WITHDRAW_LIMIT_CONFIG(String code, BigDecimal value) {
            this.code = code;
            this.value = value;
        }

        public String getCode() {
            return code;
        }

        public BigDecimal getValue() {
            return value;
        }
    }
}
